<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 停车场管理 <span class="c-gray en">&gt;</span> 车位维护 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form action="managementAll" method="post">
        <div class="text-c">

            <input type="text" name="cs_state" id="cs_state" placeholder="状态" style="width:250px" class="input-text">
            <button type="submit" class="btn btn-primary radius" id="search" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a href="javascript:;" id="deleteNotice"  onClick="deleteAll()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
            <!-- <a class="btn btn-primary radius" th:href="management.add.html" title="添加车位出租信息" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加车位出租信息</a>--></span>
        <span class="r">共有数据：<strong><spen th:text="${pageInfo.total}"></spen></strong> 条</span> </div>


    <div class="mt-20">
        <table  class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="40"><input  name="subBox"  id="checkAll" type="checkbox" value="" ></th>
                <th width="60">停车位置ID</th>
                <th width="50">所属</th>
                <th width="80">车位编号</th>
                <th width="80">当前状态</th>
                <th width="100">车位类型</th>
                <th width="100">管理类型</th>
                <th width="100">预售价格</th>
                <th width="100">预租价格</th>
                <th width="150">车位位置</th>
                <th width="100">备注</th>
                <th width="80">操作</th>

            </tr>
            </thead>
            <tbody>
            <tr class="text-c" th:each="sele,item:${pageInfo.list}">
                <td><input name="subBox"  type="checkbox" th:value="${sele.cs_id}"></td>
                <td th:text="${item.count}">停车位置id</td>
                <td th:text="${sele.cs_housing}">房产</td>
                <td th:text="${sele.cS_number}" href="javascript:;" th:onclick="admin_edit([['车位维护编辑']],[['singleid?cs_id='+${sele.cs_id}]],[[1]],[[800]],[[500]])" style="color:#416dff;">车位编号</td>
                <td th:text="${sele.cs_state}">状态</td>
                <td th:text="${sele.cs_cartype }">车位类型</td>
                <td class="text-c" th:text="${sele.cs_manage}">管理类型</td>
                <td class="text-c" th:text="${sele.cs_sell}">预售价格</td>
                <td th:text="${sele.cs_rent}">预租价格</td>
                <td th:text="${sele.ca_plilce}">位置</td>
                <td th:text="${sele.cs_remarks}">备注</td>
              <!--  <td class="td-status"><span class="label label-success radius">空闲</span></td>-->
                <td class="td-manage">
                    <!--<a style="text-decoration:none" onClick="picture_stop(this,'10001')" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a>
                    <a style="text-decoration:none" class="ml-5" th:href="|seleid?cs_id=${sele.cs_id}|" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>-->
                    <a style="text-decoration:none" class="ml-5" th:onclick="delBook([[${sele.cs_id}]],[[${sele.cS_number}]])" href="javascript:;"  title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>

                </td>
                </td>
            </tr>


            </tbody>

        </table>
        <tr >
            当前是: <spen th:text="${pageInfo.pageNum}"></spen> /<spen th:text="${pageInfo.pages}"></spen> 页
            <a th:href="@{'managementAll?&pageNum='+${pageInfo.firstPage}+'&cs_state='+${cs_state}}"><button class="btn btn-primary radius">首页</button></a>
            <a th:href="@{'managementAll?&pageNum='+${pageInfo.pageNum-1}+'&cs_state='+${cs_state}}"><button class="btn btn-primary radius">上一页</button></a>
            <a th:href="@{'managementAll?&pageNum='+${pageInfo.pageNum+1}+'&cs_state='+${cs_state}}"><button class="btn btn-primary radius">下一页</button></a>
            <a th:href="@{'managementAll?&pageNum='+${pageInfo.pages}+'&cs_state='+${cs_state}}"><button class="btn btn-primary radius">末页</button></a>
        </tr>
    </div>
</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

    function picture_start(obj,id){
        layer.confirm('确认要将状态改为以满吗？',function(index){
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="picture_stop(this,id)" href="javascript:;" title="以满"><i class="Hui-iconfont">&#xe6de;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">以满</span>');
            $(obj).remove();
            layer.msg('以满!',{icon: 6,time:1000});
        });
    }
    /*图片-下架*/
    function picture_stop(obj,id){
        layer.confirm('确认要将状态改为空闲吗？',function(index){
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="picture_start(this,id)" href="javascript:;" title="确定"><i class="Hui-iconfont">&#xe603;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">空闲</span>');
            $(obj).remove();
            layer.msg('空闲!',{icon: 5,time:1000});
        });
    }





    /*图片-删除*/
    /*function deletecar(cs_id){
        var flag=confirm("确认要删除吗？");
        if(flag){
            $.ajax({
                async:false,
                type:"POST",
                url: "delete",
                date:{cs_id:cs_id},
                success:function(data){
                    if("success" ==data ) {
                        alert("删除成功");
                        $("#"+a).remove();
                    }
            }
        })
    }
    }*/

</script>

<script type="text/javascript">
    //单个删除
    function delBook(cs_id,cS_number){
        layer.confirm("确定删除车位为:"+cS_number+" 的?",function(index){
            location.href="singledelete?cs_id="+cs_id;
        })


    };

</script>

<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/layer/2.4/layer.min.js"></script>

<script>
    //批量删除
    $(function() {
        $("#checkAll").click(function(){//给全选按钮加上点击事件
            var xz = $(this).prop("checked");
            //判断全选按钮的选中状态
            var ck = $("[name='subBox']").prop("checked",xz);
            //让class名为qx的选项的选中状态和全选按钮的选中状态一致。

        });
    });



    function admin_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }

    $("#deleteNotice").click(function(){
        var cs_id =[];
        $('input[name="subBox"]:checked').each(function(){
            cs_id+=this.value;
        });
        /*cs_id=cs_id.substring(1);*/

        if(cs_id.length<=0){
            alert("请选择要删除的数据！");
        }else{
            if(confirm("你确定删除选中的吗？")){
                $.post("singledeleteall",{cs_id:cs_id},function(date) {
                    if(data="success"){
                        window.location.reload();
                    }else if(data="error") {
                        alert("删除失败");
                    }
                })
            }
        }
    });



</script>
<!--<script>
    //单个删除
function cwdelete() {

    var cs_id="";

    $('a[name="cwdeletes"]').value(function() {
        cs_id+=this.value;
        alert(cs_id);
    })


    var flag=window.confirm("是否删除");
    if (flag) {
        $.post("deletes",{cs_id:cs_id},function(date) {
           if(date){
               window.location.reload();
           }else{
               alert("删除失败")
           }
        },"JSON")
    }

}


</script>-->

<script>
    //搜索
    $(document).ready(function () {
        $("#search").click(function () {
            var cs_state=$("#cs_state").val();

            location.href="managementAll?cs_state="+cs_state;
        })
    })

</script>

</body>
</html>